#ifndef _BASE_H_
#define _BASE_H_

#ifndef NULL
#define NULL	0
#endif

#ifndef BOOL
#define BOOL	int
#endif

#ifndef TRUE
#define TRUE	1
#endif

#ifndef FALSE
#define FALSE	0
#endif

#ifndef LOCK_BOOL
#define LOCK_BOOL	BOOL
#endif 


#ifndef INVALID
#define INVALID	0xffff
#endif

#ifndef NG
#define NG 		INVALID
#endif

#ifndef OK
#define OK		0
#endif

#ifndef PUBLIC
#define PUBLIC 
#endif

#ifndef PRIVATE
#define PRIVATE	static
#endif


#ifndef EXTERN
#define EXTERN	extern
#endif

#define align(value,bits)  ((((value - 1) >> bits)+1)<<bits)

typedef unsigned long	uint64_t;
typedef unsigned int 	uint32_t;
typedef unsigned short	uint16_t;
typedef unsigned char	uint8_t;

typedef long			int64_t;
typedef int 			int32_t;
typedef short			int16_t;
typedef char			int8_t;


typedef unsigned long	uint_64;
typedef unsigned int 	uint_32;
typedef unsigned short	uint_16;
typedef unsigned char	uint_8;

typedef long			int_64;
typedef int 			int_32;
typedef short			int_16;
typedef char			int_8;


typedef unsigned int	Addr;
typedef unsigned int	reg_t;
typedef unsigned short 	sel_t;

#define round_forward(a,base)	((((a) - 1) / (base) + 1) * (base))
#define round_backward(a,base)	(((a)/(base))*(base))
#endif
